package lz.controls.events
{

import flash.events.Event;

/**
 *  关闭事件
 */
public class CloseEvent extends Event
{

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  @eventType close
     */
    public static const CLOSE:String = "close";

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor.
     */
    public function CloseEvent(type:String, bubbles:Boolean = false,
                               cancelable:Boolean = false, detail:int = -1)
    {
        super(type, bubbles, cancelable);

        this.detail = detail;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  detail
    //----------------------------------

    /**
     *  Identifies the button in the popped up control that was clicked. This 
     *  property is for controls with multiple buttons.
     *  The Alert control sets this property to one of the following constants:
     *  <ul>
     *    <li><code>Alert.YES</code></li>
     *    <li><code>Alert.NO</code></li>
     *    <li><code>Alert.OK</code></li>
     *    <li><code>Alert.CANCEL</code></li>
     *  </ul>
     */
    public var detail:int;

    //--------------------------------------------------------------------------
    //
    //  Overridden methods: Event
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    override public function clone():Event
    {
        return new CloseEvent(type, bubbles, cancelable, detail);
    }
}

}
